/**
 * 
 */
package com.sxds.wn.service.biz;

import java.util.HashMap;
import java.util.Map;

import com.sxds.wn.dao.biz.QueryStaticDao;
import com.sxds.wn.exception.DataAccessException;
import com.sxds.wn.exception.ParameterException;
import com.sxds.wn.model.JsonPage;
import com.sxds.wn.model.Page;
import com.sxds.wn.service.BaseService;
import com.sxds.wn.service.IService;

/**
 * @author ibm
 *
 */
public class QueryStaticService extends BaseService implements IService {

	private QueryStaticDao dao;
	
	/* (non-Javadoc)
	 * @see com.sxds.wn.service.BaseService#checkPermission()
	 */
	@Override
	protected boolean checkPermission() throws SecurityException {
		return false;
	}

	/*
	 * 获取Grid内容数据
	 */
	public void getGridContent() throws DataAccessException {
		//SysLog sysLog = (SysLog)this.parseRequest(SysLog.class.getName());
		Map params = new HashMap();
		String start = request.getHttpRequest().getParameter("start");
		String limit = request.getHttpRequest().getParameter("limit");
		Page page = new Page();
		page.setEnablePage(true);
		page.setPageSize(Integer.parseInt(limit));
		page.setPageNumber(Integer.parseInt(start)/page.getPageSize()+1);
		this.dao.loadPage(page,"queryCateringTaxStasticCount","queryCateringTaxStastic", params);
		JsonPage jsonPage = new JsonPage();
		jsonPage.setTotalCount(page.getTotalObjects());
		jsonPage.setList( page.getResults() );
		this.response.setOk(true);
		this.response.getPageAttributes().put("jsonPage",jsonPage);
	}

	/* (non-Javadoc)
	 * @see com.sxds.wn.service.BaseService#validateParameters()
	 */
	@Override
	protected boolean validateParameters() throws ParameterException {
		return false;
	}

	/**
	 * @return the dao
	 */
	public QueryStaticDao getDao() {
		return dao;
	}

	/**
	 * @param dao the dao to set
	 */
	public void setDao(QueryStaticDao dao) {
		this.dao = dao;
	}


}
